#include <iostream>
#include<vector>
using namespace std;
class hjx
{
public:
    vector<vector<int>> yhsj(int n)
    {
        vector<vector<int>> v;
        v.resize(n);
        int i;
        for(i=0;i<n;i++)
        {
            v[i].resize(i+1);
            v[i][0]=1;
            v[i][i]=1;
        }
        int j=0;
        for(i=0;i<v.size();i++)
        {
            for(j=0;j<v[i].size();j++)
            {
                if(v[i][j]!=1)
                {
                    v[i][j]=v[i-1][j-1]+v[i-1][j];
                }
            }
        }
           return v;
    }
private:

};
int main()
{
    hjx h1;
    vector<vector<int>> v=h1.yhsj(5);//生成前五行杨辉三角
    int i,j;
    for(i=0;i<v.size();i++)
    {
        for(j=0;j<v[i].size();j++)
        {
            cout<<v[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}














